# class Solution:
#     def isPowerOfTwo(self, n: int) -> bool:
#         if n==0:
#             return False
#         while n!=1:
#             if n%2!=0:
#                 return False
#             n=n//2
#         return True


# class Solution:
#     def isPowerOfTwo(self, n: int) -> bool:
#         if n&n-1==0 and n!=0:
#             return True
#         else:
#             return False


class Solution:
    def isPowerOfTwo(self, n: int) -> bool:
        return (n&n-1==0 and n!=0)

s=Solution()
s.isPowerOfTwo(65536)